<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => assert_selection(
     '<div contenteditable><ul><li>|hello</li><li>world</li><li>Blink</li></ul></div>',
     'InsertOrderedList',
     '<div contenteditable><ol><li>|hello</li></ol><ul><li>world</li><li>Blink</li></ul></div>'),
     'InsertOrderedList - listify only the 1st list item');

test(() => assert_selection(
     '<div contenteditable><ul><li>hello</li><li>|world</li><li>Blink</li></ul></div>',
     'InsertOrderedList',
     '<div contenteditable><ul><li>hello</li></ul><ol><li>|world</li></ol><ul><li>Blink</li></ul></div>'),
     'InsertOrderedList - listify only the 2nd list item');

test(() => assert_selection(
     '<div contenteditable><ul><li>hello</li><li>world</li><li>|Blink</li></ul></div>',
     'InsertOrderedList',
     '<div contenteditable><ul><li>hello</li><li>world</li></ul><ol><li>|Blink</li></ol></div>'),
     'InsertOrderedList - listify only the 3nd list item');

test(() => assert_selection(
     '<div contenteditable><ol><li>|hello</li><li>world</li><li>Blink</li></oll></div>',
     'InsertUnorderedList',
     '<div contenteditable><ul><li>|hello</li></ul><ol><li>world</li><li>Blink</li></ol></div>'),
     'InsertUnorderedList - listify only the 1st list item');

test(() => assert_selection(
     '<div contenteditable><ol><li>hello</li><li>|world</li><li>Blink</li></ol></div>',
     'InsertUnorderedList',
     '<div contenteditable><ol><li>hello</li></ol><ul><li>|world</li></ul><ol><li>Blink</li></ol></div>'),
     'InsertUnorderedList - listify only the 2nd list item');

test(() => assert_selection(
     '<div contenteditable><ol><li>hello</li><li>world</li><li>|Blink</li></ol></div>',
     'InsertUnorderedList',
     '<div contenteditable><ol><li>hello</li><li>world</li></ol><ul><li>|Blink</li></ul></div>'),
     'InsertUnorderedList - listify only the 3rd list item');

test(() => assert_selection(
     '<div contenteditable><ul><li>^hello</li><li>world|</li><li>Blink</li></ul></div>',
     'InsertOrderedList',
     '<div contenteditable><ol><li>^hello</li><li>world|</li></ol><ul><li>Blink</li></ul></div>'),
     'InsertOrderedList - listify the 1st and 2nd list items');

test(() => assert_selection(
     '<div contenteditable><ul><li>hello</li><li>^world</li><li>Blink|</li></ul></div>',
     'InsertOrderedList',
     '<div contenteditable><ul><li>hello</li></ul><ol><li>^world</li><li>Blink|</li></ol></div>'),
     'InsertOrderedList - listify the 2nd and 3rd list items');

test(() => assert_selection(
     '<div contenteditable><ol><li>^hello</li><li>world|</li><li>Blink</li></ol></div>',
     'InsertUnorderedList',
     '<div contenteditable><ul><li>^hello</li><li>world|</li></ul><ol><li>Blink</li></ol></div>'),
     'InsertUnorderedList - listify the 1st and 2nd list items');

test(() => assert_selection(
     '<div contenteditable><ol><li>hello</li><li>^world</li><li>Blink|</li></ol></div>',
     'InsertUnorderedList',
     '<div contenteditable><ol><li>hello</li></ol><ul><li>^world</li><li>Blink|</li></ul></div>'),
     'InsertUnorderedList - listify the 2nd and 3rd list items');
</script>
